import request from 'lib/request';

// 获取问诊单列表
// status:
//   -1: 全部
//    0: 待处理
//    1: 已发送
//    2: 已完成

export function queryInquiryList (patientId, hospitalId) {
  let body = {
    patientId,
    hospitalId,
  }
  return request("wechat/patientInquiry/list?"+"patientId="+patientId+"&hospitalId="+hospitalId,{
    method: 'GET',
  })
}
// 查看问诊单详情
export function queryInquiryDetail (id, patientId){
  let body = {
    id,
    patientId,
  }
  return request("wechat/patientInquiry/detail?"+"id="+id+"&patientId="+patientId,{
    method: "GET",
  })
}
// 提交问诊单 //id,description,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,q12,tonguePic,facePic
export function saveInquiry(data) {
  const body = new FormData();
  Object.keys(data).forEach(key => {
    body.append(key, data[key]);
  })
  return request.post('wechat/patientInquiry/save', { body })
}
